﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace zichan.Entity
{
    /// <summary>
    /// 资产分类
    /// </summary>
    public class AsseteClassify
    {
        [Key]
        public int Id { get; set; }
        [Required(ErrorMessage ="类型名称不能为空")]
        public string Name { get; set; }
        [Required(ErrorMessage = "序号不为空")]
        [RegularExpression(@"^\+?[1-9]\d*$", ErrorMessage ="只能输入正数")]
        public int SortId { get; set; }
        [Required(ErrorMessage ="标识不为空")]
        public string Identity { get; set; }
        /// <summary>
        /// 当资产类型是服务器的时候，这个字段是必填的
        /// 资产标识(组装)
        /// </summary>
        public string SubIdentity { get; set; }
        [NotMapped]
        public int UseCount { get; set; }
    }
}
